<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>服务监控</title>
    <include file="common/tag"/>
    <style>
        body{
            background-color: #fff;
        }
        .yui-top{
            margin-top: 20px;
            margin-left: 10px;
        }
        address{
            margin-left: 10px;
        }
    </style>
</head>
<body>
    <!--页面头-->
    <div class="breadcrumbs" id="breadcrumbs">
        <script type="text/javascript">
            try{ace.settings.check('breadcrumbs' , 'fixed')}catch(e){}
        </script>

        <ul class="breadcrumb">
            <li>
                <i class="icon-home home-icon"></i>
            <li class="active">实时监控</li>
            </li>
        </ul><!-- .breadcrumb -->
    </div>

    <div class="col-sm-4 yui-top">
        <div class="widget-box">
            <div class="widget-header widget-header-flat">
                <h4 class="smaller">
                    <i class="icon-quote-left smaller-80"></i>
                    实时内存
                </h4>
            </div>

            <div class="widget-body">
                <div class="widget-main">
                    <div class="row">
                        <div class="col-xs-12">
                            <div class="user-profile row">
                                <div class="profile-user-info profile-user-info-striped">
                                    <div class="profile-info-row">
                                        <div class="profile-info-name"> 主机 </div>

                                        <div class="profile-info-value">
                                            <span class="label label-inverse yui_host" >UNKOWN</span>
                                        </div>
                                    </div>
                                </div>


                                <div class="profile-user-info profile-user-info-striped">
                                    <div class="profile-info-row">
                                        <div class="profile-info-name"> 时间 </div>

                                        <div class="profile-info-value">
                                            <span class="label label-success yui_time" >0000-00-00 00:00:00</span>
                                        </div>
                                    </div>
                                </div>


                                <div class="profile-user-info profile-user-info-striped">
                                    <div class="profile-info-row">
                                        <div class="profile-info-name"> load_avg </div>

                                        <div class="profile-info-value">
                                            <span class="badge badge-yellow yui_load_avg" >NULL</span>
                                        </div>
                                    </div>
                                </div>


                                <div class="profile-user-info profile-user-info-striped">
                                    <div class="profile-info-row">
                                        <div class="profile-info-name"> mem_total </div>

                                        <div class="profile-info-value">
                                            <span class="label label-info yui_mem_total" >NULL</span>
                                        </div>
                                    </div>
                                </div>


                                <div class="profile-user-info profile-user-info-striped">
                                    <div class="profile-info-row">
                                        <div class="profile-info-name"> mem_free </div>

                                        <div class="profile-info-value">
                                            <span class="label label-info yui_mem_free" >NULL</span>
                                        </div>
                                    </div>
                                </div>



                                <div class="profile-user-info profile-user-info-striped">
                                    <div class="profile-info-row">
                                        <div class="profile-info-name"> mem_available </div>

                                        <div class="profile-info-value">
                                            <span class="label label-info yui_mem_available" >NULL</span>
                                        </div>
                                    </div>
                                </div>


                                <div class="profile-user-info profile-user-info-striped">
                                    <div class="profile-info-row">
                                        <div class="profile-info-name"> mem_buffers </div>

                                        <div class="profile-info-value">
                                            <span class="label label-info yui_mem_buffers" >NULL</span>
                                        </div>
                                    </div>
                                </div>


                                <div class="profile-user-info profile-user-info-striped">
                                    <div class="profile-info-row">
                                        <div class="profile-info-name"> mem_cached </div>

                                        <div class="profile-info-value">
                                            <span class="label label-info yui_mem_cached" >NULL</span>
                                        </div>
                                    </div>
                                </div>

                            </div>
                        </div>
                        </div>
                    </div>

                    <hr>
                    <address>
                        <strong>GYD, Inc.</strong>
                    </address>
                </div>
            </div>
        </div>
    </div>
</body>
    <script>
        $(function () {
            real();
            setInterval(real,5000);
        })

        function real() {
            $.post("/index.php/admin/server/server_index",
                {},
                function(data,status){
                    console.log(data);
                    $(".yui_host").html(data['host']);
                    $(".yui_time").html(data['time']);
                    $(".yui_load_avg").html(data['load_avg']);
                    $(".yui_mem_total").html(data['mem_total']);
                    $(".yui_mem_free").html(data['mem_free']);
                    $(".yui_mem_available").html(data['mem_available']);
                    $(".yui_mem_buffers").html(data['mem_buffers']);
                    $(".yui_mem_cached").html(data['mem_cached']);
                }, "json"
            );
        }
    </script>

</html>